<template>
	<view class="container">
		
		<view class="logo-view" @click="debugClick">
			<u-image v-if="channel === 'jzwy'" width="200" height="200" src="https://jinzhiweiye.oss-cn-hangzhou.aliyuncs.com/2024/09/924/jinzhituoyutonglogo.jpg"></u-image>
			<u-image v-else width="200" height="200" shape="circle" src="https://dotflat-saas-res.oss-cn-shanghai.aliyuncs.com/xybaby365/app/icons/app_logo.png"></u-image>
			<view class="name">
				{{channel === 'jzwy' ? '金职托育通' : '金职托育通'}}
			</view>
		</view>
		
		<view class="cell-view">
		<!-- 	<cell-item title="关于我们" @click="aboutClick"></cell-item>
			<cell-item title="官网" @click="webSiteClick"></cell-item> -->
			<cell-item title="联系我们"  @click="contactClick"></cell-item>
		</view>
	</view>
</template>

<script>
	import CellItem from '../components/cell-item.vue'
	export default {
		components: {
			CellItem
		},
		data() {
			return {
				debugCount: 0
			}
		},
		computed: {
			channel() {
				return getApp().globalData.channel;
			},
		},
		onLoad() {
			// plus.runtime.getProperty(plus.runtime.appid,(wgtinfo)=>{
			//     console.log(JSON.stringify(wgtinfo));
			//     console.log(wgtinfo.version);//应用版本号
			// })
		},
		methods: {
			aboutClick() {
				//https://res.xxwbaby.com/public/about/index.html
				if (this.channel === 'jzwy') {
					this.$u.route({
						url: 'pages_base/common/webview',
						params: {
							url: 'http://www.jzwy123.com/list-52-1.html',
							title: '关于金职托育通'
						}
					})
				} else {
					this.$u.route({
						url: 'pages_base/common/webview',
						params: {
							url: 'https://res.xxwbaby.com/public/about/index.html',
							title: '关于小象湾'
						}
					})
				}

			},
			
			webSiteClick() {
				if (this.channel === 'jzwy') {
					
					this.$u.route({
						url: 'pages_base/common/webview',
						params: {
							url: 'https://www.jz1x.com/',
							title: '金职托育通官网'
						}
					})
				} else {
					this.$u.route({
						url: 'pages_base/common/webview',
						params: {
							url: 'https://pc.xxwbaby.com/',
							title: '小象湾官网'
						}
					})
				}

			},
			
			contactClick() {
				if (this.channel === 'jzwy') {
					uni.makePhoneCall({
					    phoneNumber: '0731-89799889'
					});
				} else {
					uni.makePhoneCall({
					    phoneNumber: '4006-345-678'
					});
				}

			},
			
			debugClick() {
				this.debugCount += 1
				console.log(this.debugCount)
				if (this.debugCount === 10) {
					this.debugCount = 0
					this.$u.route({
						url: 'pages_base/common/debug'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: $app-page-bg-color;
	}
	
	.container{
		display: flex;
		flex-direction: column;
		padding-left: 30rpx;
		padding-right: 30rpx;
		
		.logo-view{
			margin-top: 100rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			.name{
				margin-top: 20rpx;
				color: $app-font-color;
				font-size: 30rpx;
			}
		}
		
		.cell-view{
			margin-top: 60rpx;
		}
	}
	

	

</style>
